package view;
/**
 *
 * @author zhaoyingxi
 */
import java.awt.BorderLayout;

import javax.swing.JFrame;
import javax.swing.JLabel;
import java.awt.Rectangle;
import javax.swing.*;
import java.awt.event.FocusEvent;
import java.awt.event.FocusAdapter;
import Control.AirPortInfo;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;


public class AirPortInfoManagerViewT extends JFrame {
    public AirPortInfoManagerViewT() {
        try {
            jbInit();
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }

    private void jbInit() throws Exception {
        this.setTitle("AirPort Info");
        getContentPane().setLayout(null);
        contentText.setText(AirPortInfo.getContent());
        contentText.setBounds(new Rectangle(61, 78, 285, 166));
        contentText.addFocusListener(new
                AirPortInfoManagerViewT_contentText_focusAdapter(this));
        this.setResizable(false);
        thesisText.setText(AirPortInfo.getHead());
        thesisText.setBounds(new Rectangle(165, 40, 77, 20));
        thesisText.addActionListener(new
                AirPortInfoManagerViewT_thesisText_actionAdapter(this));
        thesisText.addFocusListener(new
                AirPortInfoManagerViewT_thesisText_focusAdapter(this));
        taxText.setText(AirPortInfo.getTAX());
        taxText.setBounds(new Rectangle(311, 17, 77, 20));
        taxText.addFocusListener(new
                                 AirPortInfoManagerViewT_taxText_focusAdapter(this));
        jLabel2.setText("TAX");
        jLabel2.setBounds(new Rectangle(251, 18, 42, 15));

        gstText.setText(AirPortInfo.getGST());
        gstText.setBounds(new Rectangle(310, 49, 77, 20));
        gstText.addActionListener(new
                                  AirPortInfoManagerViewT_gstText_actionAdapter(this));
        jLabel3.setText("GST");
        jLabel3.setBounds(new Rectangle(250, 53, 42, 15));
        this.getContentPane().add(contentText);
        this.getContentPane().add(thesisText);
        this.getContentPane().add(taxText);
        this.getContentPane().add(jLabel2);
        this.getContentPane().add(jTextField2);
        this.getContentPane().add(gstText);
        this.getContentPane().add(jLabel3);
        this.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
        this.setSize(400,350);
        this.setVisible(true);
//        this.setSize(this.getMaximumSize());
    }
    JTextArea contentText = new JTextArea();
    JTextField thesisText = new JTextField();
    JTextField taxText = new JTextField();
    JLabel jLabel2 = new JLabel();
    JTextField jTextField2 = new JTextField();
    JTextField gstText = new JTextField();
    JLabel jLabel3 = new JLabel();
    public static void main(String[] args){
        AirPortInfoManagerViewT a = new AirPortInfoManagerViewT();
        a.setVisible(true);
    }
    public void thesisText_focusLost(FocusEvent e) {
        AirPortInfo.setHead(thesisText.getText());
    }

    public void contentText_focusLost(FocusEvent e) {
        AirPortInfo.setContent(contentText.getText());
    }

    public void taxText_focusLost(FocusEvent e) {
        AirPortInfo.setTAX(taxText.getText());
    }

    public void gstText_actionPerformed(ActionEvent e) {
        AirPortInfo.setGST(gstText.getText());
    }

    public void thesisText_actionPerformed(ActionEvent e) {

    }
}


class AirPortInfoManagerViewT_thesisText_actionAdapter implements
        ActionListener {
    private AirPortInfoManagerViewT adaptee;
    AirPortInfoManagerViewT_thesisText_actionAdapter(AirPortInfoManagerViewT
            adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.thesisText_actionPerformed(e);
    }
}


class AirPortInfoManagerViewT_taxText_focusAdapter extends FocusAdapter {
    private AirPortInfoManagerViewT adaptee;
    AirPortInfoManagerViewT_taxText_focusAdapter(AirPortInfoManagerViewT
                                                 adaptee) {
        this.adaptee = adaptee;
    }

    public void focusLost(FocusEvent e) {
        adaptee.taxText_focusLost(e);
    }
}


class AirPortInfoManagerViewT_gstText_actionAdapter implements ActionListener {
    private AirPortInfoManagerViewT adaptee;
    AirPortInfoManagerViewT_gstText_actionAdapter(AirPortInfoManagerViewT
                                                  adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.gstText_actionPerformed(e);
    }
}


class AirPortInfoManagerViewT_thesisText_focusAdapter extends FocusAdapter {
    private AirPortInfoManagerViewT adaptee;
    AirPortInfoManagerViewT_thesisText_focusAdapter(AirPortInfoManagerViewT
            adaptee) {
        this.adaptee = adaptee;
    }

    public void focusLost(FocusEvent e) {
        adaptee.thesisText_focusLost(e);
    }
}


class AirPortInfoManagerViewT_contentText_focusAdapter extends FocusAdapter {
    private AirPortInfoManagerViewT adaptee;
    AirPortInfoManagerViewT_contentText_focusAdapter(AirPortInfoManagerViewT
            adaptee) {
        this.adaptee = adaptee;
    }

    public void focusLost(FocusEvent e) {
        adaptee.contentText_focusLost(e);
    }
}
